home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Balloons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  11.1 KB  |  313 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Balloons.h
  3.  
  4.      Contains:    Balloon Help Package Interfaces.
  5.  
  6.      Version:    Technology:    System 7.0
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1990-1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __BALLOONS__
  19. #define __BALLOONS__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __MENUS__
  28. #include <Menus.h>
  29. #endif
  30. #ifndef __TEXTEDIT__
  31. #include <TextEdit.h>
  32. #endif
  33. #ifndef __ERRORS__
  34. #include <Errors.h>
  35. #endif
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59.  
  60. /* • constants*/
  61.  
  62.  
  63. enum {
  64.     kTopLeftTipPointsLeftVariant = 0,
  65.     kTopLeftTipPointsUpVariant    = 1,
  66.     kTopRightTipPointsUpVariant    = 2,
  67.     kTopRightTipPointsRightVariant = 3,
  68.     kBottomRightTipPointsRightVariant = 4,
  69.     kBottomRightTipPointsDownVariant = 5,
  70.     kBottomLeftTipPointsDownVariant = 6,
  71.     kBottomLeftTipPointsLeftVariant = 7,
  72.     kBalloonVariantCount        = 8
  73. };
  74.  
  75. typedef SInt16                             BalloonVariant;
  76.  
  77. enum {
  78.     hmBalloonHelpVersion        = 0x0002,                        /* The real version of the Help Manager */
  79.     kHMHelpMenuID                = -16490,                        /* Resource ID and menu ID of help menu */
  80.     kHMAboutHelpItem            = 1,                            /* help menu item number of About Balloon Help… */
  81.     kHMShowBalloonsItem            = 3,                            /* help menu item number of Show/Hide Balloons */
  82.     kHMHelpID                    = -5696,                        /* ID of various Help Mgr package resources (in Pack14 range) */
  83.     kBalloonWDEFID                = 126                            /* Resource ID of the WDEF proc used in standard balloons */
  84. };
  85.  
  86.  
  87. enum {
  88.                                                                 /* Dialog item template type constant */
  89.     helpItem                    = 1                                /* key value in DITL template that corresponds to the help item */
  90. };
  91.  
  92.  
  93. enum {
  94.                                                                 /* Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
  95.     hmDefaultOptions            = 0,                            /* default options for help manager resources */
  96.     hmUseSubID                    = 1,                            /* treat resID's in resources as subID's of driver base ID (for Desk Accessories) */
  97.     hmAbsoluteCoords            = 2                                /* ignore window port origin and treat rectangles as absolute coords (local to window) */
  98. };
  99.  
  100.  
  101. enum {
  102.     hmSaveBitsNoWindow            = 4,                            /* don't create a window, just blast bits on screen. No update event is generated */
  103.     hmSaveBitsWindow            = 8,                            /* create a window, but restore bits behind window when window goes away & generate update event */
  104.     hmMatchInTitle                = 16                            /* for hwin resources, match string anywhere in window title string */
  105. };
  106.  
  107.  
  108. enum {
  109.                                                                 /* Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
  110.     kHMStringItem                = 1,                            /* pstring used in resource */
  111.     kHMPictItem                    = 2,                            /* 'PICT' ResID used in resource */
  112.     kHMStringResItem            = 3,                            /* 'STR#' ResID & index used in resource */
  113.     kHMTEResItem                = 6,                            /* Styled Text Edit ResID used in resource ('TEXT' & 'styl') */
  114.     kHMSTRResItem                = 7,                            /* 'STR ' ResID used in resource */
  115.     kHMSkipItem                    = 256,                            /* don't display a balloon */
  116.     kHMCompareItem                = 512,                            /* Compare pstring in menu item w/ PString in resource item ('hmnu' only) */
  117.     kHMNamedResourceItem        = 1024,                            /* Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) */
  118.     kHMTrackCntlItem            = 2048                            /* Reserved */
  119. };
  120.  
  121.  
  122. enum {
  123.                                                                 /* Constants for hmmHelpType's when filling out HMMessageRecord */
  124.     khmmString                    = 1,                            /* help message contains a PString */
  125.     khmmPict                    = 2,                            /* help message contains a resource ID to a 'PICT' resource */
  126.     khmmStringRes                = 3,                            /* help message contains a res ID & index to a 'STR#' resource */
  127.     khmmTEHandle                = 4,                            /* help message contains a Text Edit handle */
  128.     khmmPictHandle                = 5,                            /* help message contains a Picture handle */
  129.     khmmTERes                    = 6,                            /* help message contains a res ID to 'TEXT' & 'styl' resources */
  130.     khmmSTRRes                    = 7,                            /* help message contains a res ID to a 'STR ' resource */
  131.     kHMEnabledItem                = 0                                /* item is enabled, but not checked or control value = 0 */
  132. };
  133.  
  134.  
  135. enum {
  136.                                                                 /* ResTypes for Styled TE Handles in Resources */
  137.     kHMTETextResType            = FOUR_CHAR_CODE('TEXT'),        /* Resource Type of text data for styled TE record w/o style info */
  138.     kHMTEStyleResType            = FOUR_CHAR_CODE('styl')        /* Resource Type of style information for styled TE record */
  139. };
  140.  
  141.  
  142. enum {
  143.     kHMDisabledItem                = 1,                            /* item is disabled, grayed in menus or disabled in dialogs */
  144.     kHMCheckedItem                = 2,                            /* item is enabled, and checked or control value = 1 */
  145.     kHMOtherItem                = 3,                            /* item is enabled, and control value > 1 */
  146.                                                                 /* Method parameters to pass to HMShowBalloon */
  147.     kHMRegularWindow            = 0,                            /* Create a regular window floating above all windows */
  148.     kHMSaveBitsNoWindow            = 1,                            /* Just save the bits and draw (for MDEF calls) */
  149.     kHMSaveBitsWindow            = 2                                /* Regular window, save bits behind, AND generate update event */
  150. };
  151.  
  152.  
  153. enum {
  154.                                                                 /* Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages */
  155.     kHMMenuResType                = FOUR_CHAR_CODE('hmnu'),        /* ResType of help resource for supporting menus */
  156.     kHMDialogResType            = FOUR_CHAR_CODE('hdlg'),        /* ResType of help resource for supporting dialogs */
  157.     kHMWindListResType            = FOUR_CHAR_CODE('hwin'),        /* ResType of help resource for supporting windows */
  158.     kHMRectListResType            = FOUR_CHAR_CODE('hrct'),        /* ResType of help resource for rectangles in windows */
  159.     kHMOverrideResType            = FOUR_CHAR_CODE('hovr'),        /* ResType of help resource for overriding system balloons */
  160.     kHMFinderApplResType        = FOUR_CHAR_CODE('hfdr')        /* ResType of help resource for custom balloon in Finder */
  161. };
  162.  
  163.  
  164. struct HMStringResType {
  165.     short                             hmmResID;
  166.     short                             hmmIndex;
  167. };
  168. typedef struct HMStringResType            HMStringResType;
  169.  
  170. struct HMMessageRecord {
  171.     SInt16                             hmmHelpType;
  172.     union {
  173.         Str255                             hmmString;
  174.         SInt16                             hmmPict;
  175.         TEHandle                         hmmTEHandle;
  176.         HMStringResType                 hmmStringRes;
  177.         SInt16                             hmmPictRes;
  178.         PicHandle                         hmmPictHandle;
  179.         SInt16                             hmmTERes;
  180.         SInt16                             hmmSTRRes;
  181.     }                                 u;
  182. };
  183. typedef struct HMMessageRecord            HMMessageRecord;
  184.  
  185. typedef HMMessageRecord *                HMMessageRecPtr;
  186. typedef CALLBACK_API( OSErr , TipFunctionProcPtr )(Point tip, RgnHandle structure, Rect *r, BalloonVariant *balloonVariant);
  187. typedef STACK_UPP_TYPE(TipFunctionProcPtr)                         TipFunctionUPP;
  188. enum { uppTipFunctionProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  189. #define NewTipFunctionProc(userRoutine)                         (TipFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTipFunctionProcInfo, GetCurrentArchitecture())
  190. #define CallTipFunctionProc(userRoutine, tip, structure, r, balloonVariant)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppTipFunctionProcInfo, (tip), (structure), (r), (balloonVariant))
  191. /*  Public Interfaces  */
  192. EXTERN_API( OSErr )
  193. HMGetHelpMenuHandle                (MenuHandle *            mh)                                    THREEWORDINLINE(0x303C, 0x0200, 0xA830);
  194.  
  195. EXTERN_API( OSErr )
  196. HMShowBalloon                    (const HMMessageRecord * inHelpMessage,
  197.                                  Point                     inTip,
  198.                                  Rect *                    inHotRect,
  199.                                  TipFunctionUPP         inTipProc,
  200.                                  SInt16                 inWindowProcID,
  201.                                  BalloonVariant         inBalloonVariant,
  202.                                  SInt16                 inMethod)                            THREEWORDINLINE(0x303C, 0x0B01, 0xA830);
  203.  
  204. EXTERN_API( OSErr )
  205. HMShowMenuBalloon                (SInt16                 itemNum,
  206.                                  SInt16                 itemMenuID,
  207.                                  SInt32                 itemFlags,
  208.                                  SInt32                 itemReserved,
  209.                                  Point                     tip,
  210.                                  RectPtr                 alternateRect,
  211.                                  TipFunctionUPP         tipProc,
  212.                                  SInt16                 theProc,
  213.                                  BalloonVariant         balloonVariant)                        THREEWORDINLINE(0x303C, 0x0E05, 0xA830);
  214.  
  215. EXTERN_API( OSErr )
  216. HMRemoveBalloon                    (void)                                                        THREEWORDINLINE(0x303C, 0x0002, 0xA830);
  217.  
  218. EXTERN_API( OSErr )
  219. HMGetIndHelpMsg                    (ResType                 inWhichResType,
  220.                                  SInt16                 inWhichResID,
  221.                                  SInt16                 inMessageIndex,
  222.                                  SInt16                 inMessageState,
  223.                                  UInt32 *                outOptions,
  224.                                  Point *                outTip,
  225.                                  Rect *                    outHotRect,
  226.                                  SInt16 *                outWindowProcID,
  227.                                  BalloonVariant *        outBalloonVariant,
  228.                                  HMMessageRecord *        outHelpMessage,
  229.                                  SInt16 *                outMessageCount)                    THREEWORDINLINE(0x303C, 0x1306, 0xA830);
  230.  
  231. EXTERN_API( Boolean )
  232. HMIsBalloon                        (void)                                                        THREEWORDINLINE(0x303C, 0x0007, 0xA830);
  233.  
  234. EXTERN_API( Boolean )
  235. HMGetBalloons                    (void)                                                        THREEWORDINLINE(0x303C, 0x0003, 0xA830);
  236.  
  237. EXTERN_API( OSErr )
  238. HMSetBalloons                    (Boolean                 flag)                                THREEWORDINLINE(0x303C, 0x0104, 0xA830);
  239.  
  240. EXTERN_API( OSErr )
  241. HMSetFont                        (SInt16                 font)                                THREEWORDINLINE(0x303C, 0x0108, 0xA830);
  242.  
  243. EXTERN_API( OSErr )
  244. HMSetFontSize                    (UInt16                 fontSize)                            THREEWORDINLINE(0x303C, 0x0109, 0xA830);
  245.  
  246. EXTERN_API( OSErr )
  247. HMGetFont                        (SInt16 *                font)                                THREEWORDINLINE(0x303C, 0x020A, 0xA830);
  248.  
  249. EXTERN_API( OSErr )
  250. HMGetFontSize                    (UInt16 *                fontSize)                            THREEWORDINLINE(0x303C, 0x020B, 0xA830);
  251.  
  252. EXTERN_API( OSErr )
  253. HMSetDialogResID                (SInt16                 resID)                                THREEWORDINLINE(0x303C, 0x010C, 0xA830);
  254.  
  255. EXTERN_API( OSErr )
  256. HMSetMenuResID                    (SInt16                 menuID,
  257.                                  SInt16                 resID)                                THREEWORDINLINE(0x303C, 0x020D, 0xA830);
  258.  
  259. EXTERN_API( OSErr )
  260. HMBalloonRect                    (const HMMessageRecord * inMessage,
  261.                                  Rect *                    outRect)                            THREEWORDINLINE(0x303C, 0x040E, 0xA830);
  262.  
  263. EXTERN_API( OSErr )
  264. HMBalloonPict                    (const HMMessageRecord * inMessage,
  265.                                  PicHandle *            outPict)                            THREEWORDINLINE(0x303C, 0x040F, 0xA830);
  266.  
  267. EXTERN_API( OSErr )
  268. HMScanTemplateItems                (SInt16                 whichID,
  269.                                  SInt16                 whichResFile,
  270.                                  ResType                 whichType)                            THREEWORDINLINE(0x303C, 0x0410, 0xA830);
  271.  
  272. EXTERN_API( OSErr )
  273. HMExtractHelpMsg                (ResType                 inType,
  274.                                  SInt16                 inResID,
  275.                                  SInt16                 inMessageIndex,
  276.                                  SInt16                 inMessageState,
  277.                                  HMMessageRecord *        outMessage)                            THREEWORDINLINE(0x303C, 0x0711, 0xA830);
  278.  
  279. EXTERN_API( OSErr )
  280. HMGetDialogResID                (SInt16 *                resID)                                THREEWORDINLINE(0x303C, 0x0213, 0xA830);
  281.  
  282. EXTERN_API( OSErr )
  283. HMGetMenuResID                    (SInt16                 menuID,
  284.                                  SInt16 *                resID)                                THREEWORDINLINE(0x303C, 0x0314, 0xA830);
  285.  
  286. EXTERN_API( OSErr )
  287. HMGetBalloonWindow                (WindowPtr *            window)                                THREEWORDINLINE(0x303C, 0x0215, 0xA830);
  288.  
  289.  
  290.  
  291.  
  292.  
  293. #if PRAGMA_STRUCT_ALIGN
  294.     #pragma options align=reset
  295. #elif PRAGMA_STRUCT_PACKPUSH
  296.     #pragma pack(pop)
  297. #elif PRAGMA_STRUCT_PACK
  298.     #pragma pack()
  299. #endif
  300.  
  301. #ifdef PRAGMA_IMPORT_OFF
  302. #pragma import off
  303. #elif PRAGMA_IMPORT
  304. #pragma import reset
  305. #endif
  306.  
  307. #ifdef __cplusplus
  308. }
  309. #endif
  310.  
  311. #endif /* __BALLOONS__ */
  312.  
  313.